package tools;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import view.ViewOc_Boat;
import view.ViewOc_Boat_Ben;
import view.ViewOc_Data;
import view.ViewOc_Data_Ben;
import view.ViewOc_Data_Ice;
import view.ViewOc_Data_Pla;
import view.ViewOc_Data_Recover;
import view.ViewOc_Depth;
import view.ViewOc_Depth_Ben;
import view.ViewOc_News;
import view.ViewOc_Property;
import view.ViewOc_Property_Ben;
import view.ViewOc_Property_Tools;
import view.ViewOc_Property_Tools_Ben;
import view.ViewOc_Sea_Area;
import view.ViewOc_Sea_Ben_Area;
import view.ViewOc_Station;
import view.ViewOc_Station_Ben;
import view.ViewOc_Study;
import view.ViewOc_User_Info;
import view.ViewOc_Voyage;
import view.ViewOc_Voyage_Ben;
import view.ViewSystem_Log;
public class InterfaceForResultSetToList {
	
	public List<ViewSystem_Log>ViewSystem_Log(ResultSet rs)
	{
		List<ViewSystem_Log>list =new ArrayList<ViewSystem_Log>();
		try {
			Integer i=1;
			while(rs.next())
			{
				ViewSystem_Log viewsystem_log=new ViewSystem_Log();
				viewsystem_log.setKey(rs.getString("ID"));
				viewsystem_log.setLOG_KIND(rs.getString("LOG_KIND"));
				viewsystem_log.setIP(rs.getString("IP"));
				viewsystem_log.setUPDATE_TIME(rs.getString("UPDATE_TIME"));
				viewsystem_log.setFINISH(rs.getString("FINISH"));
				viewsystem_log.setUSERNAME(rs.getString("USERNAME"));
				list.add(viewsystem_log);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
		
		
		
	}
	
	
	
	public List<ViewOc_User_Info>ViewOc_User_Info(ResultSet rs)
	{
		
		List<ViewOc_User_Info>list =new ArrayList<ViewOc_User_Info>();
		try {
			Integer i=1;
			while(rs.next())
			{
				ViewOc_User_Info viewoc_data=new ViewOc_User_Info();
				viewoc_data.setId(i.toString());
				viewoc_data.setKey(rs.getString("ID"));
				viewoc_data.setBackup(rs.getString("BACKUP"));
				viewoc_data.setEmail(rs.getString("EMAIL"));
				viewoc_data.setIsactive(rs.getString("ISACTIVE"));
				viewoc_data.setLast_action(rs.getString("LAST_ACTION"));
				viewoc_data.setLogin_time(rs.getString("LOGIN_TIME"));
				viewoc_data.setPassword(rs.getString("PASSWORD"));
				viewoc_data.setRealname(rs.getString("REALNAME"));
				viewoc_data.setUsername(rs.getString("USERNAME"));
				viewoc_data.setId_card(rs.getString("ID_CARD"));
				list.add(viewoc_data);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
		
		
		
		
		
	}
	
	public List<ViewOc_Data_Ben>ViewOc_Data_Ben(ResultSet rs)
	{
		List<ViewOc_Data_Ben>list =new ArrayList<ViewOc_Data_Ben>();
		try {
			Integer i=1;
			while(rs.next())
			{
				ViewOc_Data_Ben viewoc_data=new ViewOc_Data_Ben();
				viewoc_data.setId(i.toString());
				viewoc_data.setKey(rs.getString("ID"));
				viewoc_data.setOc_boat_id(rs.getString("OC_BOAT_ID"));
				viewoc_data.setOc_deplist_id(rs.getString("OC_DEPLIST_ID"));
				viewoc_data.setOc_property_id(rs.getString("OC_PROPERTY_ID"));
				viewoc_data.setOc_property_tools_id(rs.getString("OC_PROPERTY_TOOLS_ID"));
				viewoc_data.setOc_station_id(rs.getString("OC_STATION_ID"));
				viewoc_data.setOc_voyage_id(rs.getString("OC_VOYAGE_ID"));
				viewoc_data.setValue_key(rs.getString("VALUE_KEY"));
				list.add(viewoc_data);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
		
		
		
	}
	public List<ViewOc_Data_Ice> ViewOc_Data_Ice(ResultSet rs)
	{
		List<ViewOc_Data_Ice>list =new ArrayList<ViewOc_Data_Ice>();
		try {
			Integer i=1;
			while(rs.next())
			{
				ViewOc_Data_Ice viewoc_data=new ViewOc_Data_Ice();
				viewoc_data.setId(i.toString());
				viewoc_data.setKey(rs.getString("ID"));
				viewoc_data.setOc_boat_id(rs.getString("OC_BOAT_ID"));
				viewoc_data.setOc_deplist_id(rs.getString("OC_DEPLIST_ID"));
				viewoc_data.setOc_property_id(rs.getString("OC_PROPERTY_ID"));
				viewoc_data.setOc_property_tools_id(rs.getString("OC_PROPERTY_TOOLS_ID"));
				viewoc_data.setOc_station_id(rs.getString("OC_STATION_ID"));
				viewoc_data.setOc_voyage_id(rs.getString("OC_VOYAGE_ID"));
				viewoc_data.setValue_key(rs.getString("VALUE_KEY"));
				list.add(viewoc_data);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
		
		
		
	}
	public List<ViewOc_Data_Pla> ViewOc_Data_Pla(ResultSet rs)
	{
		List<ViewOc_Data_Pla>list =new ArrayList<ViewOc_Data_Pla>();
		try {
			Integer i=1;
			while(rs.next())
			{
				ViewOc_Data_Pla viewoc_data=new ViewOc_Data_Pla();
				viewoc_data.setId(i.toString());
				viewoc_data.setKey(rs.getString("ID"));
				viewoc_data.setOc_boat_id(rs.getString("OC_BOAT_ID"));
				viewoc_data.setOc_deplist_id(rs.getString("OC_DEPLIST_ID"));
				viewoc_data.setOc_property_id(rs.getString("OC_PROPERTY_ID"));
				viewoc_data.setOc_property_tools_id(rs.getString("OC_PROPERTY_TOOLS_ID"));
				viewoc_data.setOc_station_id(rs.getString("OC_STATION_ID"));
				viewoc_data.setOc_voyage_id(rs.getString("OC_VOYAGE_ID"));
				viewoc_data.setValue_key(rs.getString("VALUE_KEY"));
				list.add(viewoc_data);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
		
		
		
	}
	
	
	public List<ViewOc_Data_Recover>ViewOc_Data_Recover(ResultSet rs)
	{
		List<ViewOc_Data_Recover>list =new ArrayList<ViewOc_Data_Recover>();
		try {
			Integer i=1;
			while(rs.next())
			{
				ViewOc_Data_Recover viewoc_data=new ViewOc_Data_Recover();
				viewoc_data.setId(i.toString());
				viewoc_data.setKey(rs.getString("ID"));
				viewoc_data.setDate_num(rs.getString("DATE_NUM"));
				viewoc_data.setUpdate_time(rs.getString("UPDATE_TIME"));
				viewoc_data.setFile_name(rs.getString("FILE_NAME"));
				list.add(viewoc_data);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
		
		
	}
	
	
	public List<ViewOc_Data>ViewOc_Data(ResultSet rs)
	{
		
		
		List<ViewOc_Data>list =new ArrayList<ViewOc_Data>();
		try {
			Integer i=1;
			while(rs.next())
			{
				ViewOc_Data viewoc_data=new ViewOc_Data();
				viewoc_data.setId(i.toString());
				viewoc_data.setKey(rs.getString("ID"));
				viewoc_data.setOc_boat_id(rs.getString("OC_BOAT_ID"));
				viewoc_data.setOc_deplist_id(rs.getString("OC_DEPLIST_ID"));
				viewoc_data.setOc_property_id(rs.getString("OC_PROPERTY_ID"));
				viewoc_data.setOc_property_tools_id(rs.getString("OC_PROPERTY_TOOLS_ID"));
				viewoc_data.setOc_station_id(rs.getString("OC_STATION_ID"));
				viewoc_data.setOc_voyage_id(rs.getString("OC_VOYAGE_ID"));
				viewoc_data.setValue_key(rs.getString("VALUE_KEY"));
				list.add(viewoc_data);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
		
	}
	
	public List<ViewOc_Station_Ben>ViewOc_Station_Ben(ResultSet rs)
	{
		
		List<ViewOc_Station_Ben>list =new ArrayList<ViewOc_Station_Ben>();
		try {
			Integer i=1;
			while(rs.next())
			{
				
				ViewOc_Station_Ben viewoc_sea_area=new ViewOc_Station_Ben();
				viewoc_sea_area.setId(i.toString());
				viewoc_sea_area.setKey(rs.getString("ID"));
				viewoc_sea_area.setDepth(rs.getString("DEPTH"));
				viewoc_sea_area.setDimensionality(rs.getString("DIMENSIONALITY"));
				viewoc_sea_area.setLongitude(rs.getString("LONGITUDE"));
				viewoc_sea_area.setOc_sea_area(rs.getString("OC_SEA_AREA"));
				viewoc_sea_area.setOc_voyage_id(rs.getString("OC_VOYAGE_ID"));
				viewoc_sea_area.setStation_name(rs.getString("STATION_NAME"));
				viewoc_sea_area.setTerritorial_waters(rs.getString("TERRITORIAL_WATERS"));
				viewoc_sea_area.setVoyage_name(rs.getString("VOYAGE_NAME"));
				viewoc_sea_area.setWork_time(rs.getString("WORK_TIME"));
				list.add(viewoc_sea_area);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
		
		
		
	}
	public List<ViewOc_Station>ViewOc_Station(ResultSet rs)
	{
		
		List<ViewOc_Station>list =new ArrayList<ViewOc_Station>();
		try {
			Integer i=1;
			while(rs.next())
			{
				
				ViewOc_Station viewoc_sea_area=new ViewOc_Station();
				viewoc_sea_area.setId(i.toString());
				viewoc_sea_area.setKey(rs.getString("ID"));
				viewoc_sea_area.setDepth(rs.getString("DEPTH"));
				viewoc_sea_area.setDimensionality(rs.getString("DIMENSIONALITY"));
				viewoc_sea_area.setLongitude(rs.getString("LONGITUDE"));
				viewoc_sea_area.setOc_sea_area(rs.getString("OC_SEA_AREA"));
				viewoc_sea_area.setOc_voyage_id(rs.getString("OC_VOYAGE_ID"));
				viewoc_sea_area.setStation_name(rs.getString("STATION_NAME"));
				viewoc_sea_area.setTerritorial_waters(rs.getString("TERRITORIAL_WATERS"));
				viewoc_sea_area.setVoyage_name(rs.getString("VOYAGE_NAME"));
				viewoc_sea_area.setWork_time(rs.getString("WORK_TIME"));
				list.add(viewoc_sea_area);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
		
		
		
		
	}
	public List<ViewOc_Property_Tools>ViewOc_Property_Tools(ResultSet rs)
	{

		List<ViewOc_Property_Tools>list =new ArrayList<ViewOc_Property_Tools>();
		try {
			Integer i=1;
			while(rs.next())
			{
				
				ViewOc_Property_Tools viewoc_sea_area=new ViewOc_Property_Tools();
				viewoc_sea_area.setProperty_name(rs.getString("PROPERTY_NAME"));
				viewoc_sea_area.setId(i.toString());
				viewoc_sea_area.setKey(rs.getString("ID"));
				viewoc_sea_area.setPid(rs.getString("PID"));
				viewoc_sea_area.setTools_name(rs.getString("TOOLS_NAME"));
				viewoc_sea_area.setDef(rs.getString("DEF"));	
				
				list.add(viewoc_sea_area);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
	}
	
	
	public List<ViewOc_Property_Tools_Ben>ViewOc_Property_Tools_Ben(ResultSet rs)
	{

		List<ViewOc_Property_Tools_Ben>list =new ArrayList<ViewOc_Property_Tools_Ben>();
		try {
			Integer i=1;
			while(rs.next())
			{
				
				ViewOc_Property_Tools_Ben viewoc_sea_area=new ViewOc_Property_Tools_Ben();
				viewoc_sea_area.setProperty_name(rs.getString("PROPERTY_NAME"));
				viewoc_sea_area.setId(i.toString());
				viewoc_sea_area.setKey(rs.getString("ID"));
				viewoc_sea_area.setPid(rs.getString("PID"));
				viewoc_sea_area.setTools_name(rs.getString("TOOLS_NAME"));
				viewoc_sea_area.setDef(rs.getString("DEF"));	
				
				list.add(viewoc_sea_area);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
	}
	
	
	
	
	
	public List<ViewOc_Property>ViewOc_Property(ResultSet rs)
	{

		List<ViewOc_Property>list =new ArrayList<ViewOc_Property>();
		try {
			Integer i=1;
			while(rs.next())
			{
				
				ViewOc_Property viewoc_sea_area=new ViewOc_Property();
				viewoc_sea_area.setProperty_name(rs.getString("PROPERTY_NAME"));
				viewoc_sea_area.setId(i.toString());
				viewoc_sea_area.setKey(rs.getString("ID"));
				list.add(viewoc_sea_area);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
	}
	
	public List<ViewOc_Property_Ben>ViewOc_Property_Ben(ResultSet rs)
	{

		List<ViewOc_Property_Ben>list =new ArrayList<ViewOc_Property_Ben>();
		try {
			Integer i=1;
			while(rs.next())
			{
				
				ViewOc_Property_Ben viewoc_sea_area=new ViewOc_Property_Ben();
				viewoc_sea_area.setProperty_name(rs.getString("PROPERTY_NAME"));
				viewoc_sea_area.setId(i.toString());
				viewoc_sea_area.setKey(rs.getString("ID"));
				list.add(viewoc_sea_area);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		return list;
		
		
		
	}
	public List<ViewOc_Sea_Ben_Area>ViewOc_Sea_Ben_Area(ResultSet rs)
	{
		
		List<ViewOc_Sea_Ben_Area>list =new ArrayList<ViewOc_Sea_Ben_Area>();
		try {
			Integer i=1;
			while(rs.next())
			{
				
				ViewOc_Sea_Ben_Area viewoc_sea_area=new ViewOc_Sea_Ben_Area();
				viewoc_sea_area.setOc_sea_area(rs.getString("OC_SEA_AREA"));
				viewoc_sea_area.setId(i.toString());
				viewoc_sea_area.setKey(rs.getString("ID"));
				list.add(viewoc_sea_area);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		return list;
		
	}
	
	
	
	public List<ViewOc_Sea_Area>ViewOc_Sea_Area(ResultSet rs)
    {
		List<ViewOc_Sea_Area>list =new ArrayList<ViewOc_Sea_Area>();
		try {
			Integer i=1;
			while(rs.next())
			{
				
				ViewOc_Sea_Area viewoc_sea_area=new ViewOc_Sea_Area();
				viewoc_sea_area.setOc_sea_area(rs.getString("OC_SEA_AREA"));
				viewoc_sea_area.setId(i.toString());
				viewoc_sea_area.setKey(rs.getString("ID"));
				list.add(viewoc_sea_area);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		return list;
		
		
    }
	
	public List<ViewOc_Voyage>ViewOc_Voyage(ResultSet rs)
	{
		List<ViewOc_Voyage>list =new ArrayList<ViewOc_Voyage>();
		try {
			Integer i=1;
			while(rs.next())
			{
				
				ViewOc_Voyage viewoc_news=new ViewOc_Voyage();
				viewoc_news.setBoatid(rs.getString("BOATID"));
				viewoc_news.setId(i.toString());
				viewoc_news.setVoyage_name(rs.getString("VOYAGE_NAME"));
				viewoc_news.setKey(rs.getString("ID"));
				viewoc_news.setBoatname(rs.getString("BOATNAME"));
				list.add(viewoc_news);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		return list;
	}
	
	public List<ViewOc_Voyage_Ben>ViewOc_Voyage_Ben(ResultSet rs)
	{
		List<ViewOc_Voyage_Ben>list =new ArrayList<ViewOc_Voyage_Ben>();
		try {
			Integer i=1;
			while(rs.next())
			{
				
				ViewOc_Voyage_Ben viewoc_news=new ViewOc_Voyage_Ben();
				viewoc_news.setBoatid(rs.getString("BOATID"));
				viewoc_news.setId(i.toString());
				viewoc_news.setVoyage_name(rs.getString("VOYAGE_NAME"));
				viewoc_news.setKey(rs.getString("ID"));
				viewoc_news.setBoatname(rs.getString("BOATNAME"));
				list.add(viewoc_news);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		return list;
	}
	
	
	
	public List<ViewOc_News>ViewOc_News(ResultSet rs)
	{
		
		List<ViewOc_News>list =new ArrayList<ViewOc_News>();
		try {
			Integer i=1;
			while(rs.next())
			{
				
				ViewOc_News viewoc_news=new ViewOc_News();
				viewoc_news.setTitle(rs.getString("NEWS_TITLE"));
				viewoc_news.setId(i.toString());
				viewoc_news.setUpdate_time(rs.getString("UPDATE_TIME"));
				viewoc_news.setKey(rs.getString("ID"));
				list.add(viewoc_news);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
		
	}
	public List<ViewOc_Study> ViewOc_Study(ResultSet rs)
	{
		
		List<ViewOc_Study>list =new ArrayList<ViewOc_Study>();
		try {
			Integer i=1;
			while(rs.next())
			{
				
				ViewOc_Study viewoc_news=new ViewOc_Study();
				viewoc_news.setTitle(rs.getString("NEWS_TITLE"));
				viewoc_news.setId(rs.getString("ID"));
				viewoc_news.setUpdate_time(rs.getString("UPDATE_TIME"));
				viewoc_news.setKey(rs.getString("ID"));
				list.add(viewoc_news);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
		
	}
	public List<ViewOc_Boat>ViewOc_Boat(ResultSet rs)
	{
		
		List<ViewOc_Boat>list =new ArrayList<ViewOc_Boat>();
		try {
			Integer i=1;
			while(rs.next())
			{
				
				ViewOc_Boat viewoc_boat=new ViewOc_Boat();
				viewoc_boat.setOc_boatname(rs.getString("OC_BOATNAME"));
				viewoc_boat.setId(i.toString());
				viewoc_boat.setKey(rs.getString("ID"));
				list.add(viewoc_boat);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
		
	}
	
	public List<ViewOc_Boat_Ben>ViewOc_Boat_Ben(ResultSet rs)
	{
		
		List<ViewOc_Boat_Ben>list =new ArrayList<ViewOc_Boat_Ben>();
		try {
			Integer i=1;
			while(rs.next())
			{
				
				ViewOc_Boat_Ben viewoc_boat_ben=new ViewOc_Boat_Ben();
				viewoc_boat_ben.setOc_boatname(rs.getString("OC_BOATNAME"));
				viewoc_boat_ben.setId(i.toString());
				viewoc_boat_ben.setKey(rs.getString("ID"));
				list.add(viewoc_boat_ben);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
		
	}
	public List<ViewOc_Depth_Ben>ViewOc_Depth_Ben(ResultSet rs) 
	{
		
		List<ViewOc_Depth_Ben>list =new ArrayList<ViewOc_Depth_Ben>();
		try {
			Integer i=1;
			while(rs.next())
			{
				
				ViewOc_Depth_Ben viewoc_boat=new ViewOc_Depth_Ben();
				viewoc_boat.setOc_depth(rs.getString("DEPTH"));
				viewoc_boat.setId(i.toString());
				viewoc_boat.setKey(rs.getString("ID"));
				list.add(viewoc_boat);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
		
	}
	public List<ViewOc_Depth>ViewOc_Depth(ResultSet rs)
	{
		
		List<ViewOc_Depth>list =new ArrayList<ViewOc_Depth>();
		try {
			Integer i=1;
			while(rs.next())
			{
				
				ViewOc_Depth viewoc_boat=new ViewOc_Depth();
				viewoc_boat.setOc_depth(rs.getString("DEPTH"));
				viewoc_boat.setId(i.toString());
				viewoc_boat.setKey(rs.getString("ID"));
				list.add(viewoc_boat);
				i=i+1;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
		
	}
	
	
}
